use vergen::{vergen, Config};
use vergen::{TimeZone, TimestampKind};

use dotenv;

fn main() {
  use std::io::{self, Write};

  let mut config = Config::default();
  // Generate all three date/time instructions
  *config.build_mut().kind_mut() = TimestampKind::All;
  // Change the date/time instructions to show `Local` time
  *config.build_mut().timezone_mut() = TimeZone::Local;

  // Generate the instructions
  let _ = vergen(config);

  println!("cargo:rustc-link-lib=framework=ColorSync");

  
  if let Ok(env) = dotenv::dotenv_iter() {
    for (k, v) in env.flatten() {
      println!("cargo:rustc-env={}={}", k, v);
    }
  }
  tauri_build::build()
}
